package MyApplicationExceptionBean.client;

import javaTransactionAPI.StudentManager;

import javax.naming.InitialContext;
import javax.naming.NamingException;

import org.junit.Test;

import applicationException.MyApplicationExceptionNotRollBack;
import applicationException.MyApplicationExceptionRollBack;

public class MyApplicationExceptionBeanClient {

	@Test
	public void MyApplicationExceptionRollBack() throws NamingException, MyApplicationExceptionRollBack, MyApplicationExceptionNotRollBack{
		InitialContext context = new InitialContext();
		StudentManager sm = (StudentManager)context.lookup("MyApplicationExceptionRollBackBean/remote");
		
		sm.addStudent(null);
	
	}
	
	@Test
	public void MyApplicationExceptionNotRollBack() throws NamingException, MyApplicationExceptionRollBack, MyApplicationExceptionNotRollBack{
		InitialContext context = new InitialContext();
		StudentManager sm = (StudentManager)context.lookup("MyApplicationExceptionNotRollBackBean/remote");
		
		sm.addStudent(null);
	
	}
}
